package com.service.impl;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dao.UserDao;
import com.entity.User;

/**
 * @description:
 * @author:wsc
 * @date:2020年3月9日 下午4:05:34
 */
@Service
//@Transactional
public class UserServiceImpl {
	@Resource
	public UserDao userDao;
	
	public boolean login1(String email,String password,HttpSession session){
		if(this.userDao.login(email, password)!=null){
			session.setAttribute(email, password);
			return true;
		}else {
			return false;	
		}
	}
	public void addUser(User user){
		userDao.addUser(user);
	}
	public void updateUser(User user){
		userDao.updateUser(user);
	}
	public void deleteUser(User user){
		userDao.deleteUser(user);
	}
	public User queryUser1(int uid){
		User user=userDao.queryUser1(uid);
		return user;
	}
	public User queryUser2(String email){
		User user=userDao.queryUser2(email);
		return user;
	}

}
